package vashion.azeroth.back.controller.tran;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import vashion.azeroth.core.personal.tran.pojo.PersonalRechargeOrder;
import vashion.azeroth.core.result.ApiResult;
import vashion.azeroth.core.service.tran.PersonalRechargeService;

import com.pingplusplus.model.Charge;

@Controller
@RequestMapping("/back/tran")
public class RechargeController {

	@Autowired
	private PersonalRechargeService<Charge> rechargeService;
	
    @RequestMapping("getRechargeOrderList.htm")
    @ResponseBody
    public ApiResult<List<PersonalRechargeOrder>> getRechargeOrderList(@ModelAttribute("PersonalRechargeOrder") PersonalRechargeOrder rechargeOrder) {
//    	rechargeOrder.setRechargeType(AzerothConstants.PersonalRechargeOrder.RechargeType.recharged);
        return rechargeService.getRechargeOrderList(rechargeOrder);
    }
    
    @RequestMapping("confirmRechargeOrder.htm")
    @ResponseBody
    public ApiResult<String> confirmRechargeOrder(String rechargeOrderNo) {
    	
    	return rechargeService.confirmRechargeOrder(rechargeOrderNo);
    }
}
